/*
 * @Date: 2021-12-15 09:02:26
 * @LastEditors: LeeKing
 * @LastEditTime: 2021-12-16 15:48:26
 * @FilePath: \hrsaas\src\api\departments.js
 */
import request from '@/utils/request.js'

// 获取组织架构列表
export function getDepartmentsList() {
  return request({
    url: '/company/department'
  })
}

// 删除组织
export function removeDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 根据Id部门数据
export function getDepartmentsById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

// 根据Id编辑部门数据
export function editDepartmentsById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
